#ifndef __CC_H__
#define __CC_H__
#include <stdlib.h>
#include <stdio.h>
#include <rtthread.h>
typedef int sys_prot_t;
#define LWIP_PROVIDE_ERRNO
#if defined (__GNUC__) & !defined (__CC_ARM)
#define LWIP_TIMEVAL_PRIVATE            0 
#include <time.h>
#include <stdint.h>

typedef long int suseconds_t;
typedef struct {
    time_t tv_sec;     /* seconds */
    suseconds_t tv_usec; /* and microseconds */
}timeval;
 

#else
#define LWIP_TIMEVAL_PRIVATE            0 
#include <time.h>
#endif
#ifndef BYTE_ORDER
#define BYTE_ORDER                      LITTLE_ENDIAN
#endif
/* define compiler specific symbols */
#if defined (__ICCARM__)
#define PACK_STRUCT_BEGIN
#define PACK_STRUCT_STRUCT
#define PACK_STRUCT_END
#define PACK_STRUCT_FIELD(x)            x
#define PACK_STRUCT_USE_INCLUDES
#elif defined (__CC_ARM)
#define PACK_STRUCT_BEGIN __packed
#define PACK_STRUCT_STRUCT
#define PACK_STRUCT_END
#define PACK_STRUCT_FIELD(x)            x
#elif defined (__GNUC__)
#define PACK_STRUCT_BEGIN
#define PACK_STRUCT_STRUCT              __attribute__ ((__packed__))
#define PACK_STRUCT_END
#define PACK_STRUCT_FIELD(x)            x
#endif
#define LWIP_PLATFORM_ASSERT(x)                                                     \
do {                                                                                \
rt_kprintf("Assertion \"%s\" failed at line %d in %s\n", x, __LINE__, __FILE__);    \
} while(0)
/* Define random number generator function */
#define LWIP_RAND()                     ((u32_t)rand()) 
#endif /* __CC_H__ */
